<?xml version="1.0"?>

<st-source>
<time-stamp>From VisualWorks® NonCommercial, 7.6 of March 3, 2008 on March 10, 2009 at 2:34:02 pm</time-stamp>


<class>
<name>OrderTest</name>
<environment>SupplyChain</environment>
<super>XProgramming.SUnit.TestCase</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>order </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category></category>
<attributes>
<package>SupplyChain</package>
</attributes>
</class>

<!-- -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -   -->


<methods>
<class-id>SupplyChain.OrderTest class</class-id> <category>instance creation</category>

<body package="SupplyChain" selector="new">new
	"Answer a newly created and initialized instance."

	^super new initialize</body>
</methods>

<!-- -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -   -->


<comment>
<class-id>SupplyChain.OrderTest</class-id>
<body>This is an SUnit test class for the Order Class

Instance Variables:
	order	&lt;Order&gt;	An Instance of the Order class

</body>
</comment>

<methods>
<class-id>SupplyChain.OrderTest</class-id> <category>accessing</category>

<body package="SupplyChain" selector="order">order
	^order</body>

<body package="SupplyChain" selector="order:">order: anObject
	order := anObject</body>
</methods>

<methods>
<class-id>SupplyChain.OrderTest</class-id> <category>initialize-release</category>

<body package="SupplyChain" selector="initialize">initialize
	"Initialize a newly created instance. This method must answer the receiver."

	" *** Edit the following to properly initialize instance variables ***"
	order := Order new.
	" *** And replace this comment with additional initialization code *** "
	^self</body>
</methods>

<methods>
<class-id>SupplyChain.OrderTest</class-id> <category>Running</category>

<body package="SupplyChain" selector="setUp">setUp
	|col|
	col := OrderedCollection new.
	col add: 'A'.
	col add: 'B'.
	col add: 'C'.
	order with: col atHighPriority: true.
	^self.</body>

<body package="SupplyChain" selector="testAdd">testAdd
	order add: 'D'.
	self	assert: (order contains: 'D').</body>

<body package="SupplyChain" selector="testContains">testContains
	order add: 'D'.
	self assert: (order contains: 'D').
	order remove: 'D'.
	self deny: (order contains: 'D').</body>

<body package="SupplyChain" selector="testIsHighPriority">testIsHighPriority
	order setPriority: true.
	self assert: (order isHighPriority).
	order setPriority: false.
	self deny: (order isHighPriority).</body>

<body package="SupplyChain" selector="testRemove">testRemove
	order add: 'D'.
	order remove: 'D'.
	self	deny: (order contains: 'D').</body>

<body package="SupplyChain" selector="testSetPriority">testSetPriority
	order setPriority: false.
	self deny: (order isHighPriority).
	order setPriority: true.
	self assert: (order isHighPriority).</body>

<body package="SupplyChain" selector="testWithAtHighPriority">testWithAtHighPriority
	|col|
	col := OrderedCollection new.
	col add: 1; add:2; add:3.
	order with: col atHighPriority: false.
	self assert: ((order items) = col) &amp; ((order priority) = false).
	order := Order new.</body>

<body package="SupplyChain" selector="testWithAtHighPriorityBy">testWithAtHighPriorityBy
	|col|
	col := OrderedCollection new.
	col add: 1; add:2; add:3.
	order with: col atHighPriority: false by: nil.
	self assert: ((order items) = col) &amp; ((order priority) = false) &amp; ((order retailer) = nil).
	order := Order new.</body>
</methods>

</st-source>
